```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>栈与队列：数据结构的双生花</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .serif {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .btn-hover {
            transition: all 0.3s ease;
        }
        .btn-hover:hover {
            transform: translateY(-2px);
        }
        .highlight {
            position: relative;
            z-index: 1;
        }
        .highlight:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 30%;
            background-color: rgba(199, 210, 254, 0.5);
            z-index: -1;
            transition: all 0.3s ease;
        }
        .highlight:hover:after {
            height: 50%;
        }
        .mermaid {
            background-color: white;
            border-radius: 0.5rem;
            padding: 1rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 md:py-32 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <h1 class="serif text-4xl md:text-6xl font-bold mb-6 leading-tight">栈与队列：<span class="highlight">数据结构的双生花</span></h1>
            <p class="text-xl md:text-2xl opacity-90 mb-10 max-w-3xl mx-auto">探索两种基础数据结构的内在美与实用价值</p>
            <div class="flex justify-center space-x-4">
                <a href="#stack" class="btn-hover bg-white text-indigo-700 font-semibold py-3 px-6 rounded-full shadow-lg inline-flex items-center">
                    <i class="fas fa-layer-group mr-2"></i> 了解栈
                </a>
                <a href="#queue" class="btn-hover bg-indigo-800 text-white font-semibold py-3 px-6 rounded-full shadow-lg inline-flex items-center">
                    <i class="fas fa-people-arrows mr-2"></i> 了解队列
                </a>
            </div>
        </div>
    </section>

    <!-- Introduction Section -->
    <section class="py-16 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl">
            <div class="bg-white rounded-xl shadow-lg p-8 md:p-10">
                <p class="text-gray-700 text-lg md:text-xl leading-relaxed">
                    在计算机科学中，<span class="font-semibold text-indigo-600">栈（Stack）</span>和<span class="font-semibold text-purple-600">队列（Queue）</span>是两种常见的数据结构，它们在解决问题时具有不同的特点和应用场景。虽然它们都是用来存储和操作数据的容器，但它们的工作原理和操作方式却有着明显的区别。今天，我们将探讨栈和队列之间的异同，以及它们在实际应用中的应用场景。
                </p>
                <div class="mt-10 text-center">
                    <img src="https://cdn.nlark.com/yuque/0/2024/jpeg/21449790/1716975528607-6aa07ed8-c2dd-4f7f-8611-08ee652a6b8f.jpeg" alt="栈与队列对比图" class="rounded-lg shadow-md mx-auto max-w-full h-auto">
                    <p class="text-sm text-gray-500 mt-2">栈与队列的基本操作对比示意图</p>
                </div>
                <p class="text-gray-700 text-lg md:text-xl leading-relaxed mt-8">
                    我们可以看到栈和队列在数据存取的顺序上有着明显的不同。在栈中，最后压入的元素总是最先弹出，这就好像我们在叠放书籍时，后放的书籍会被先取出一样。而在队列中，最先入队的元素总是最先出队，就像排队买票时，先来的人会先得到服务一样。
                </p>
            </div>
        </div>
    </section>

    <!-- Stack Section -->
    <section id="stack" class="py-16 px-4 md:px-0 bg-indigo-50">
        <div class="container mx-auto max-w-5xl">
            <div class="flex items-center mb-10">
                <div class="bg-indigo-600 p-3 rounded-full shadow-lg">
                    <i class="fas fa-layer-group text-white text-2xl"></i>
                </div>
                <h2 class="serif text-3xl md:text-4xl font-bold ml-4 text-indigo-800">栈（Stack）</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                    <h3 class="serif text-2xl font-bold text-indigo-700 mb-4">定义和特点</h3>
                    <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1716975579899-0785130b-5e06-4aa4-a9ca-763a4e99d2ab.png" alt="栈示意图" class="rounded-lg mb-6 w-full">
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <div class="bg-indigo-100 p-1 rounded-full mr-3 mt-1">
                                <i class="fas fa-circle text-indigo-600 text-xs"></i>
                            </div>
                            <div>
                                <span class="font-semibold">定义：</span>栈是一种后进先出（Last-In-First-Out，LIFO）的数据结构，最后压入栈的元素将会最先被弹出。
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-indigo-100 p-1 rounded-full mr-3 mt-1">
                                <i class="fas fa-circle text-indigo-600 text-xs"></i>
                            </div>
                            <div>
                                <span class="font-semibold">存取顺序：</span>栈中元素的存取顺序是后进先出的，也就是最后压入栈的元素会先被访问和移除。
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-indigo-100 p-1 rounded-full mr-3 mt-1">
                                <i class="fas fa-circle text-indigo-600 text-xs"></i>
                            </div>
                            <div>
                                <span class="font-semibold">示例：</span>想象一堆盘子叠放在一起，你每次只能在顶部放入或取出盘子，最后放入的盘子会先被拿走。
                            </div>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                    <h3 class="serif text-2xl font-bold text-indigo-700 mb-4">基本操作</h3>
                    <div class="grid grid-cols-2 gap-4 mb-6">
                        <div class="bg-indigo-100 p-4 rounded-lg">
                            <div class="text-indigo-700 font-semibold mb-2">入栈（Push）</div>
                            <p class="text-sm">将元素压入栈的顶部</p>
                        </div>
                        <div class="bg-indigo-100 p-4 rounded-lg">
                            <div class="text-indigo-700 font-semibold mb-2">出栈（Pop）</div>
                            <p class="text-sm">从栈的顶部移除元素</p>
                        </div>
                        <div class="bg-indigo-100 p-4 rounded-lg">
                            <div class="text-indigo-700 font-semibold mb-2">查看栈顶（Peek）</div>
                            <p class="text-sm">查看栈顶部的元素</p>
                        </div>
                    </div>
                    
                    <h3 class="serif text-2xl font-bold text-indigo-700 mb-4">内部实现</h3>
                    <div class="mb-4">
                        <div class="flex items-center mb-2">
                            <i class="fas fa-square text-indigo-500 mr-2"></i>
                            <h4 class="font-semibold">基于数组的实现</h4>
                        </div>
                        <p class="text-sm pl-6">利用数组的固定大小和连续内存空间特性，将栈顶指针（或索引）指向当前栈顶元素的位置。</p>
                    </div>
                    <div>
                        <div class="flex items-center mb-2">
                            <i class="fas fa-square text-purple-500 mr-2"></i>
                            <h4 class="font-semibold">基于链表的实现</h4>
                        </div>
                        <p class="text-sm pl-6">利用链表的动态内存分配特性，将每个节点存储为栈中的元素，栈顶指针指向链表的头节点。</p>
                    </div>
                </div>
            </div>
            
            <div class="mt-8 bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                <h3 class="serif text-2xl font-bold text-indigo-700 mb-4">应用场景</h3>
                <div class="grid md:grid-cols-2 gap-6">
                    <div class="flex items-start">
                        <div class="bg-indigo-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-code-branch text-indigo-600"></i>
                        </div>
                        <div>
                            <h4 class="font-semibold text-lg mb-2">函数调用</h4>
                            <p class="text-gray-700">函数调用的过程中，局部变量、参数和返回地址等信息都存储在栈中，实现了函数调用的递归性和局部性。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="bg-indigo-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-calculator text-indigo-600"></i>
                        </div>
                        <div>
                            <h4 class="font-semibold text-lg mb-2">表达式求值</h4>
                            <p class="text-gray-700">栈在中缀表达式转换为后缀表达式以及后缀表达式的计算中起着重要作用，例如逆波兰表达式。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="bg-indigo-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-undo text-indigo-600"></i>
                        </div>
                        <div>
                            <h4 class="font-semibold text-lg mb-2">回溯算法</h4>
                            <p class="text-gray-700">在回溯算法中，栈常用于存储当前搜索路径以及回溯到上一状态的信息，用于实现搜索和回溯的过程。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="bg-indigo-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-sitemap text-indigo-600"></i>
                        </div>
                        <div>
                            <h4 class="font-semibold text-lg mb-2">递归</h4>
                            <p class="text-gray-700">栈常用于递归函数的实现中。每次递归调用时，函数的局部变量和参数都被压入栈中，直到递归结束返回结果。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Queue Section -->
    <section id="queue" class="py-16 px-4 md:px-0 bg-purple-50">
        <div class="container mx-auto max-w-5xl">
            <div class="flex items-center mb-10">
                <div class="bg-purple-600 p-3 rounded-full shadow-lg">
                    <i class="fas fa-people-arrows text-white text-2xl"></i>
                </div>
                <h2 class="serif text-3xl md:text-4xl font-bold ml-4 text-purple-800">队列（Queue）</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                    <h3 class="serif text-2xl font-bold text-purple-700 mb-4">定义和特点</h3>
                    <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1716975611736-4116f200-762c-4369-bb17-81cc467969e1.png" alt="队列示意图" class="rounded-lg mb-6 w-full">
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <div class="bg-purple-100 p-1 rounded-full mr-3 mt-1">
                                <i class="fas fa-circle text-purple-600 text-xs"></i>
                            </div>
                            <div>
                                <span class="font-semibold">定义：</span>队列是一种先进先出（First-In-First-Out，FIFO）的数据结构，最先进入队列的元素将会最先被访问和移除。
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-purple-100 p-1 rounded-full mr-3 mt-1">
                                <i class="fas fa-circle text-purple-600 text-xs"></i>
                            </div>
                            <div>
                                <span class="font-semibold">存取顺序：</span>队列中元素的存取顺序是先进先出的，也就是最先进入队列的元素会先被访问和移除。
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="bg-purple-100 p-1 rounded-full mr-3 mt-1">
                                <i class="fas fa-circle text-purple-600 text-xs"></i>
                            </div>
                            <div>
                                <span class="font-semibold">示例：</span>想象一群人排队购买电影票，先到的人会先买到票，后到的人会在队尾排队等候。
                            </div>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                    <h3 class="serif text-2xl font-bold text-purple-700 mb-4">基本操作</h3>
                    <div class="grid grid-cols-2 gap-4 mb-6">
                        <div class="bg-purple-100 p-4 rounded-lg">
                            <div class="text-purple-700 font-semibold mb-2">入队（Enqueue）</div>
                            <p class="text-sm">将元素添加到队列的末尾</p>
                        </div>
                        <div class="bg-purple-100 p-4 rounded-lg">
                            <div class="text-purple-700 font-semibold mb-2">出队（Dequeue）</div>
                            <p class="text-sm">从队列的头部移除元素</p>
                        </div>
                        <div class="bg-purple-100 p-4 rounded-lg">
                            <div class="text-purple-700 font-semibold mb-2">查看队首（Front）</div>
                            <p class="text-sm">查看队列头部的元素</p>
                        </div>
                        <div class="bg-purple-100 p-4 rounded-lg">
                            <div class="text-purple-700 font-semibold mb-2">查看队尾（Rear）</div>
                            <p class="text-sm">查看队列尾部的元素</p>
                        </div>
                    </div>
                    
                    <h3 class="serif text-2xl font-bold text-purple-700 mb-4">内部实现</h3>
                    <div class="mb-4">
                        <div class="flex items-center mb-2">
                            <i class="fas fa-square text-indigo-500 mr-2"></i>
                            <h4 class="font-semibold">基于数组的实现</h4>
                        </div>
                        <p class="text-sm pl-6">利用数组的连续内存空间，将队首指针和队尾指针分别指向队列的头部和尾部位置，采用循环数组（环形缓冲区）方式避免空间浪费。</p>
                    </div>
                    <div>
                        <div class="flex items-center mb-2">
                            <i class="fas fa-square text-purple-500 mr-2"></i>
                            <h4 class="font-semibold">基于链表的实现</h4>
                        </div>
                        <p class="text-sm pl-6">利用链表的动态内存分配特性，将每个节点存储为队列中的元素，队首指针指向链表的头节点，队尾指针指向链表的尾节点。</p>
                    </div>
                </div>
            </div>
            
            <div class="mt-8 bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                <h3 class="serif text-2xl font-bold text-purple-700 mb-4">应用场景</h3>
                <div class="grid md:grid-cols-2 gap-6">
                    <div class="flex items-start">
                        <div class="bg-purple-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-tasks text-purple-600"></i>
                        </div>
                        <div>
                            <h4 class="font-semibold text-lg mb-2">任务调度</h4>
                            <p class="text-gray-700">队列常用于任务调度系统中，按照先来先服务的原则对任务进行排队和处理。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="bg-purple-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-comments text-purple-600"></i>
                        </div>
                        <div>
                            <h4 class="font-semibold text-lg mb-2">消息传递</h4>
                            <p class="text-gray-700">消息队列是一种常见的消息传递机制，用于实现异步通信和解耦系统各个组件之间的依赖关系。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="bg-purple-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-buffer text-purple-600"></i>
                        </div>
                        <div>
                            <h4 class="font-semibold text-lg mb-2">缓冲区管理</h4>
                            <p class="text-gray-700">队列常用于实现缓冲区，用于临时存储数据并平衡生产者和消费者之间的速度差异。</p>
                        </div>
                    </div>
                    <div class="flex items-start">
                        <div class="bg-purple-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-project-diagram text-purple-600"></i>
                        </div>
                        <div>
                            <h4 class="font-semibold text-lg mb-2">广度优先搜索</h4>
                            <p class="text-gray-700">在图的遍历中，队列常用于实现广度优先搜索算法，用于按层级遍历图的节点。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Comparison Section -->
    <section class="py-16 px-4 md:px-0 bg-gray-50">
        <div class="container mx-auto max-w-5xl">
            <div class="text-center mb-12">
                <h2 class="serif text-3xl md:text-4xl font-bold text-gray-800 mb-4">栈与队列的比较</h2>
                <p class="text-lg text-gray-600 max-w-3xl mx-auto">深入理解两种数据结构的差异与适用场景</p>
            </div>
            
            <div class="bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                <h3 class="serif text-2xl font-bold text-gray-800 mb-6">操作效率对比</h3>
                
                <div class="overflow-x-auto">
                    <table class="min-w-full bg-white rounded-lg overflow-hidden">
                        <thead class="bg-gray-100">
                            <tr>
                                <th class="py-3 px-4 text-left font-semibold text-gray-700">操作类型</th>
                                <th class="py-3 px-4 text-left font-semibold text-indigo-600">栈</th>
                                <th class="py-3 px-4 text-left font-semibold text-purple-600">队列</th>
                                <th class="py-3 px-4 text-left font-semibold text-gray-700">时间复杂度</th>
                            </tr>
                        </thead>
                        <tbody class="divide-y divide-gray-200">
                            <tr>
                                <td class="py-3 px-4">插入操作</td>
                                <td class="py-3 px-4 text-indigo-600">Push</td>
                                <td class="py-3 px-4 text-purple-600">Enqueue</td>
                                <td class="py-3 px-4 font-mono">O(1)</td>
                            </tr>
                            <tr>
                                <td class="py-3 px-4">删除操作</td>
                                <td class="py-3 px-4 text-indigo-600">Pop</td>
                                <td class="py-3 px-4 text-purple-600">Dequeue</td>
                                <td class="py-3 px-4 font-mono">O(1)</td>
                            </tr>
                            <tr>
                                <td class="py-3 px-4">访问操作</td>
                                <td class="py-3 px-4 text-indigo-600">Peek</td>
                                <td class="py-3 px-4 text-purple-600">Front/Rear</td>
                                <td class="py-3 px-4 font-mono">O(1)</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                
                <div class="mt-8">
                    <div class="mermaid">
                        graph TD
                            A[数据结构选择] -->|后进先出| B[栈]
                            A -->|先进先出| C[队列]
                            B --> D[函数调用]
                            B --> E[表达式求值]
                            B --> F[回溯算法]
                            C --> G[任务调度]
                            C --> H[消息队列]
                            C --> I[广度优先搜索]
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Java Implementation Section -->
    <section class="py-16 px-4 md:px-0 bg-gray-100">
        <div class="container mx-auto max-w-5xl">
            <div class="flex items-center mb-10">
                <div class="bg-gray-800 p-3 rounded-full shadow-lg">
                    <i class="fab fa-java text-white text-2xl"></i>
                </div>
                <h2 class="serif text-3xl md:text-4xl font-bold ml-4 text-gray-800">Java中的实现</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                    <h3 class="serif text-2xl font-bold text-gray-800 mb-4">Stack 类</h3>
                    <p class="text-gray-700 mb-4"><code class="bg-gray-100 px-2 py-1 rounded">Stack</code> 类是 Java 中实现栈的经典类，它继承自 <code class="bg-gray-100 px-2 py-1 rounded">Vector</code> 类，使用动态数组实现。</p>
                    <div class="bg-gray-800 rounded-lg p-4 mb-4">
                        <pre class="text-gray-300 text-sm overflow-x-auto"><code>import java.util.Stack;

Stack&lt;Integer&gt; stack = new Stack&lt;&gt;();
stack.push(1);  // 入栈
stack.pop();    // 出栈
stack.peek();   // 查看栈顶</code></pre>
                    </div>
                    <p class="text-gray-700"><span class="font-semibold text-red-500">注意：</span>由于 <code class="bg-gray-100 px-2 py-1 rounded">Stack</code> 类基于向量实现，性能较差，在大部分情况下不推荐使用。</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                    <h3 class="serif text-2xl font-bold text-gray-800 mb-4">Queue 接口</h3>
                    <p class="text-gray-700 mb-4"><code class="bg-gray-100 px-2 py-1 rounded">Queue</code> 接口是 Java 中实现队列的标准接口，定义了队列的基本操作方法。</p>
                    <div class="bg-gray-800 rounded-lg p-4 mb-4">
                        <pre class="text-gray-300 text-sm overflow-x-auto"><code>import java.util.Queue;
import java.util.LinkedList;

Queue&lt;Integer&gt; queue = new LinkedList&lt;&gt;();
queue.offer(1);  // 入队
queue.poll();    // 出队
queue.peek();    // 查看队首</code></pre>
                    </div>
                    <p class="text-gray-700"><span class="font-semibold">常见实现类：</span><code class="bg-gray-100 px-2 py-1 rounded">LinkedList</code>, <code class="bg-gray-100 px-2 py-1 rounded">ArrayDeque</code>, <code class="bg-gray-100 px-2 py-1 rounded">PriorityQueue</code></p>
                </div>
            </div>
            
            <div class="mt-8 bg-white rounded-xl shadow-lg p-6 md:p-8 card-hover">
                <h3 class="serif text-2xl font-bold text-gray-800 mb-4">最佳实践</h3>
                <div class="bg-blue-50 border-l-4 border-blue-500 p-4 mb-6">
                    <div class="flex">
                        <div class="flex-shrink-0">
                            <i class="fas fa-lightbulb text-blue-500 mt-1"></i>
                        </div>
                        <div class="ml-3">
                            <p class="text-sm text-blue-700">
                                在现代Java开发中，<code class="bg-blue-100 px-1 py-0.5 rounded">ArrayDeque</code> 通常比 <code class="bg-blue-100 px-1 py-0.5 rounded">Stack</code> 类更高效，是作为栈使用的推荐选择。
                            </p>
                        </div>
                    </div>
                </div>
                
                <div class="bg-gray-800 rounded-lg p-4">
                    <pre class="text-gray-300 text-sm overflow-x-auto"><code>import java.util.ArrayDeque;
import java.util.Deque;

// 使用 ArrayDeque 作为栈
Deque&lt;Integer&gt; stack = new ArrayDeque&lt;&gt;();
stack.push(1);  // 入栈
stack.pop();    // 出栈
stack.peek();   // 查看栈顶

// 使用 ArrayDeque 作为队列
Deque&lt;Integer&gt; queue = new ArrayDeque&lt;&gt;();
queue.offer(1);  // 入队
queue.poll();    // 出队
queue.peek();    // 查看队首</code></pre>
                </div>
            </div>
        </div>
    </section>

    <!-- Summary Section -->
    <section class="py-16 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl">
            <div class="bg-gradient-to-r from-indigo-500 to-purple-600 rounded-xl shadow-xl p-8 md:p-10 text-white">
                <h2 class="serif text-3xl md:text-4xl font-bold mb-6">关键要点总结</h2>
                <div class="grid md:grid-cols-2 gap-6">
                    <div>
                        <div class="flex items-center mb-4">
                            <div class="bg-white bg-opacity-20 p-2 rounded-full mr-4">
                                <i class="fas fa-layer-group"></i>
                            </div>
                            <h3 class="serif text-xl font-bold">栈（LIFO）</h3>
                        </div>
                        <ul class="space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle mt-1 mr-2 text-white text-opacity-70"></i>
                                <span>后进先出的数据结构</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle mt-1 mr-2 text-white text-opacity-70"></i>
                                <span>适用于函数调用、递归、回溯等场景</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle mt-1 mr-2 text-white text-opacity-70"></i>
                                <span>Java中可使用 <code class="bg-white bg-opacity-20 px-1 rounded">ArrayDeque</code> 实现</span>
                            </li>
                        </ul>
                    </div>
                    <div>
                        <div class="flex items-center mb-4">
                            <div class="bg-white bg-opacity-20 p-2 rounded-full mr-4">
                                <i class="fas fa-people-arrows"></i>
                            </div>
                            <h3 class="serif text-xl font-bold">队列（FIFO）</h3>
                        </div>
                        <ul class="space-y-2">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle mt-1 mr-2 text-white text-opacity-70"></i>
                                <span>先进先出的数据结构</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle mt-1 mr-2 text-white text-opacity-70"></i>
                                <span>适用于任务调度、消息队列、BFS等场景</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle mt-1 mr-2 text-white text-opacity-70"></i>
                                <span>Java中可使用 <code class="bg-white bg-opacity-20 px-1 rounded">LinkedList</code> 或 <code class="bg-white bg-opacity-20 px-1 rounded">ArrayDeque</code> 实现</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-10 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <div class="text-xl font-bold text-white">技术小馆</div>
                    <div class="text-sm mt-1">探索技术的无限可能</div>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition duration-300 inline-flex items-center">
                        <i class="fas fa-globe mr-2"></i> http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-sm text-center text-gray-500">
                &copy; 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
        
        // 平滑滚动
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
    </script>
</body>
</html>
```